package com.topnav.mc.admin.entity.wrapper;

import com.topnav.mc.admin.entity.param.AuthorizationParam;
import com.topnav.mc.admin.entity.param.RoleAuthorizationParam;
import com.topnav.mc.base.mc.McWrapper;

/**
 * @Author: kenny
 * @Date: 2024/2/27 10:35
 */
public class RoleAuthorizationWrapper extends McWrapper<RoleAuthorizationParam> {
    public RoleAuthorizationWrapper(RoleAuthorizationParam entity) {
        super(entity);
        //这里要处理当前用户的所有的权限
        if (entity != null){
            if (entity.getId()!=null){this.eq("ra.id",entity.getId());}
            if (entity.getRoleId()!=null){this.eq("ra.role_id",entity.getRoleId());}
            if (entity.getAuthId()!=null){this.eq("ra.auto_id",entity.getAuthId());}
            this.orderByAsc("a.at_path");
        }
    }
}
